package com.zhouyu.service;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @BelongsProject: spring
 * @BelongsPackage: com.zhouyu.service
 * @Author: liuchanghao
 * @CreateTime: 2024-07-16  11:47
 * @Description: TODO
 * @Version: 1.0
 */
public class LiuChangHaoCondition implements Condition {
	@Override
	public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
		try {
			context.getClassLoader().loadClass("com.zhouyu.service.User");
			return true;
		} catch (ClassNotFoundException e) {
			return false;
		}
	}
}
